package com.xsir.dto;

import com.xsir.entity.User;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author xsir
 * @date 2020/11/9
 */
@Setter
@Getter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class UserInfo implements Serializable {
    private Long id;
    private String email;
    private String motto;
    private String avatar;
    private String account;
    private String username;
    private String classroom;
    private LocalDateTime createTime;
    
    public UserInfo(User user) {
        id = user.getId();
        email = user.getEmail();
        motto = user.getMotto();
        avatar = user.getAvatar();
        account = user.getAccount();
        username = user.getUsername();
        classroom = user.getClassroom();
        createTime = user.getCreateTime();
    }
}
